package chapter_23.thread;

/**
 * Created by Administrator
 * Created time 2018/8/9 13:12.
 */
public class ThreadTest {

    public static void main(String[] args) {
        // 获取主线程
        Thread thread = Thread.currentThread();
        System.out.println(thread.getName());

        // 创建线程t1,参数是一个线程执行对象Runner
        Thread t1 = new MyThread();
        // 开始线程t1
        t1.start();

        // 创建线程t1,参数是一个线程执行对象Runner
        Thread t2 = new MyThread("MyThread");
        // 开始线程t1
        t2.start();
    }

}
